home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
.net 2002 March
/
DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin
/
pc
/
PC Software
/
free_browsing
/
DavesQckSearchDbar3-14
/
dqsd.exe
/
searches
/
winres.xml
< prev
next >
Wrap
Text File
|
2002-09-27
|
3KB
|
83 lines
<search function="winres">
<name>WinRes</name>
<description>WinRes will open a browser window of a specified size.
<div class="helpboxDescLabels">Examples:</div>
<table class="helpboxDescTable">
<tr>
<td>winres 800 600 or winres /height:800 /width:600</td>
</tr>
<tr>
<td>will open a browser window that is 800 pixels wide and 600 pixels tall.</td>
</tr>
<tr>
<td>Optionally, specify a URL as the last argument: </td>
</tr>
<tr>
<td>winres 800 600 http://www.mysite.com or</td>
</tr>
<tr>
<td>winres http://www.mysite.com /w:800 /h:600</td>
</tr>
</table>
</description>
<contributor>Neel Doshi</contributor>
<category>Functions</category>
<script><![CDATA[
function winres(q) {
if (nullArgs("winres", q))
return false;
// First parse the arguments
var switch_list = new Array("height", "width");
var args = parseArgs(q, switch_list);
var args_width = "";
var args_height = "";
var url = "";
// check if the required switches are set
if ( typeof args.switch_val["height"] == "undefined" || args.switch_val["height"] == "" )
{
// Try using the original syntax if the from switch was not found
var args_array = q.split(' ');
var args_width = args_array.shift();
var args_height = args_array.shift();
url = args_array.shift();
}
else
{
args_height = args.switch_val["height"];
if ( typeof args.switch_val["width"] != "undefined" && args.switch_val["width"] != "" )
{
args_width = args.switch_val["width"];
}
url = args.q;
}
// Next determine if the next argument is a valid integer
if (args_width.match(/^(\d)+$/) == null || args_width == 0)
{
alert("The first argument must be an integer representing the window width in pixels");
return false;
}
// Next determine if the next argument is a valid integer
if (args_height.match(/^(\d)+$/) == null || args_height == 0)
{
alert("The second argument must be an integer representing the window height in pixels");
return false;
}
var WinAttrib;
WinAttrib = 'width=' + args_width + ',height=' + args_height +
',scrollbars=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,status=yes,directories=yes';
window.open(url,'New1',WinAttrib);
}
]]></script>
<copyright>
Copyright (c) 2002 David Bau
Distributed under the terms of the
GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
</copyright>
</search>